Menu

Wiki usage

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
Edit Sidebar
Main > Areaportals

Main.Areaportals History

Hide minor edits - Show changes to output

February 04, 2005, at 02:00 AM by bjarne
Changed line 99 from:
[[Profiles/Bjarne]]
to:
- [[Profiles/Bjarne]]
January 31, 2005, at 04:31 PM by bjarne
Changed lines 92-93 from:
!!Download the example *.map file
[[http://dynamic6.gamespy.com/~rjukanproject/tiki/tiki-download_file.php?fileId=2|Here is the link to download the example *.map file used in this tutorial.]]
to:
!!Download the example *.map file here
Here is the link to download the example *.map file used in this tutorial: Attach:areaportal_tutorial.zip
January 31, 2005, at 04:25 PM by bjarne
Added line 15:
Added line 17:
Changed lines 29-31 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=9
to:

Img:areaportal_sphear_1.jpg
Changed lines 33-34 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=10
to:

Img:areaportal_sphear_2.jpg
Changed lines 37-39 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=11
to:

Img:areaportal_sphear_3.jpg
Changed lines 44-46 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=12
to:

Img:areaportal_cones_1.jpg
Changed lines 48-50 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=13
to:

Img:areaportal_cones_2.jpg
Changed lines 52-53 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=14
to:

Img:areaportal_cones_3.jpg
Changed lines 62-64 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=15
to:

Img:areaportal_doorselected.jpg
Changed lines 66-68 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=16
to:

Img:areaportal_portalselected.jpg
Changed lines 75-77 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=17
to:

Img:areaportal_nofilter.jpg
Changed lines 79-81 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=18
to:

Img:areaportal_entityfilter.jpg
January 31, 2005, at 04:20 PM by bjarne
Changed line 15 from:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=8
to:
Img:areaportal_overview.jpg
January 25, 2005, at 06:24 PM by bjarne
Changed lines 1-3 from:
Tutorial has not yet been transfered from http://www.planetmedalofhonor.com/rjukanproject/

-[[Profiles/Bjarne]]
to:
!Area portal, tutorial

This tutorial will attempt to teach by example how to use the '''common/areaportal''' texture.

(:toc:)

!!Introduction
You know that the map '''V2 Facility''' has one of the best FPS:es among the maps shipped with MOH:AA... Not really that strange as there are a lot of corridors that does not show that much of the map at once, so there is not a lot to draw for the graphic engine. But there is another reason that the blazing FPS of the '''V2 Facility''' has been achieved as well... If you have a modest or bad computer: you may have noticed that FPS drops every time the doors to the V2 area is open... this is because the V2 area is not drawn when they are closed.

So? You say... naturally the things I cant see is not drawn!

Well, this is unfortunately not true. Especially when it comes to doors. But it can be true if you learn to use '''areaportals'''.
!!The problem
Consider these three rooms:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=8
...the picture above shows three rooms. Two of them contains some complex brushes. One contains the player starting points and nothing more. The rooms are connected with short corridors. At both ends of the corridors, there are doors.

Normally '''every''' brush in this little map will be drawn '''all the time'''.

If you doubt me, soon is the time for you to look like this: (o_0) ...and yell Eureka!

The doors to the room with the sphere has no area portals, the doors to the room with the twelve cones '''does''' contain area portals. Now lets look at the rooms from the middle room using the '''r_showtris 2''' command ( if you don't know this command, learn about it [[TutorialParameters|here]] ).

The two doors '''without areaportals''':

With both doors open:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=9
With the farthest door closed:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=10

With both doors closed:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=11
...as you can see: The contents of the room is draw even if there are two closed doors in the way. If this is news to you, make this face now: (o_0)

Now the two doors '''with areaportals''':
With both doors open:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=12
With the farthest door closed:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=13
With both doors closed:
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=14

...this is what I expect many of you thought happened all the time a door closed. But not without some area portals and some conscious architectural decisions.
!!How area portals work
Area portals work together with structural brushes ( if you don't know what a structural brush is, read [[http://w1.261.telia.com/%7Eu26123488/vis/visfordummies.htm|"Vis for Dummies"]] ) to create a closed section in the map: a separate area. When an area is closed, it is not drawn if you are outside that area And if you are inside a closed area, nothing outside it is drawn. To close an area, you need it to be totally sealed off from the rest of the map with a combination of area portals and structural brushes.
!!How area portals don't work
To create a separate area, it must be sealed. No translucent brushes ( like windows and water) and no fence textures ( like iron gates or fences ) and no entities ( other than doors ) can be part of the sealing off of the area.
!!How to insert area portals in your map
If you have a func_rotatingdoor entity like this ( door selected in red ):
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=15
...place a brush with the '''common/areaportal''' texture like this ( area portal selected i red ):
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=16
... so that is sticks out into the ( structural ) wall a few units. It should be:
* Bigger than the doors height and width
* Thinner than the doors "depth"
* Stick out a bit into the wall on each side of the door ( sides, over and under)
* NOT stick outside the doors "front" and "back"
Here is how it should look in MOHRadiant ( You can't see the area portal brush ):
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=17
...and here is the same view with the View->Filter->Entities activated ( a func_rotatingdoor is an entity ):
Img:http://dynamic6.gamespy.com/~rjukanproject/tiki/show_image.php?id=18
That's it!
!!Controlling area portals manually
Sooner or later you will for some reason want to manually activate and deactivate an area portal instead of doing it "automagically" with a door. An example of this is when you create a hatch in the floor/ceiling that turns up or down by executing a move command on a script_object entity in the script of the map, like this:
$hatch rotateXup 90
In this case you will have to deactivate the area portal manually once the hatch starts to open, and activate it once it has been closed again. This is done with these two simple commands:
$my_hatch closeportal // Closes the area portal and seals the area
and
$my_hatch openportal // Opens the area portal, exposing the area
Observe that you are '''NOT''' giving the ''openportal'' and ''closeportal'' commands to the area portal itself. You actually give it to an entity that touches the area portal.
The example *.map file in the next section contains a scripted hatch that controls an area portal manually.
!!Download the example *.map file
[[http://dynamic6.gamespy.com/~rjukanproject/tiki/tiki-download_file.php?fileId=2|Here is the link to download the example *.map file used in this tutorial.]]
!!End
This concludes this tutorial. Time to yell ''EUREKA''

'''EUREKA!'''

[[Profiles/Bjarne]]
January 25, 2005, at 09:04 AM by bjarne
Added lines 1-3:
Tutorial has not yet been transfered from http://www.planetmedalofhonor.com/rjukanproject/

-[[Profiles/Bjarne]]

Recent Changes Printable View Page History Edit Page [Attributes] [Printable View] [WikiHelp]
Page last modified on February 04, 2005, at 02:00 AM